package com.example.sys.org.dao;

import com.example.core.dao.BaseTreeDao;
import com.example.sys.org.po.SysDept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;
import java.util.List;

@Mapper
public interface SysDeptDao extends BaseTreeDao<SysDept> {

    @Select("select * from sys_dept where parent_id is null order by order_num asc")
    @Override
    List<SysDept> findRoot();

    @Select("select * from sys_dept where parent_id =#{pid} order by order_num asc")
    @Override
    List<SysDept> findByPId(@Param("pid") Serializable pid);
}
